﻿using System.Collections.Generic;
using System.IO;

namespace LogikBug.ModularMvc.Locations
{
	public class DirectoryLocation : Location<string>
	{
		#region Constructors

		public DirectoryLocation(string directory)
		{
			var list = Directory.GetFiles(directory, "*.dll", SearchOption.AllDirectories);
			List = new List<string>(list);
		}

		#endregion

		public override sealed IEnumerable<string> List
		{
			get
			{
				return base.List;
			}
			protected set
			{
				base.List = value;
			}
		}

		public override IEnumerator<string> GetEnumerator()
		{
			return List.GetEnumerator();
		}
	}
}
